;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File:         div.sch
; Description:  DIV benchmarks
; Author:       Richard Gabriel
; Created:      8-Apr-85
; Modified:     19-Jul-85 18:28:01 (Bob Shaw)
;               23-Jul-87 (Will Clinger)
; Language:     Scheme
; Status:       Public Domain
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
;;; DIV2 -- Benchmark which divides by 2 using lists of n ()'s.
;;; This file contains a recursive as well as an iterative test.
 
(define (create-n n)
  (if (= n 0)
      '()
      (cons '() (create-n (- n 1)))))
 
(define *ll* (create-n 200))
 
;(define (iterative-div2 l)
;  (do ((l l (cddr l))
;       (a '() (cons (car l) a)))
;      ((null? l) a)))
 
(define (recursive-div2 l)
  (if (null? l)
      '()
      (cons (car l) (recursive-div2 (cdr (cdr l))))))


;;; for the iterative test call: (test-1 *ll*)
;;; for the recursive test call: (test-2 *ll*)

(define main
  (begin
    ;(display (iterative-div2 *ll*)) (newline)
    (display (recursive-div2 *ll*)) (newline)))

